package com.xy.auth;

import com.xy.api.model.dto.system.UserInfoDTO;

public class UserContext {

    private static final ThreadLocal<UserInfoDTO> userInfoThreadLocal = new ThreadLocal<>();

    public static void put(UserInfoDTO userInfo) {
        userInfoThreadLocal.set(userInfo);
    }

    public static UserInfoDTO get() {
        return userInfoThreadLocal.get();
    }

    public static void clear() {
        userInfoThreadLocal.remove();
    }
}
